//
//  cpliuchengCell2.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/12.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "cpliuchengCell2.h"
#import "UIView+Yuanjiao.h"

@implementation cpliuchengCell2

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - 20 * kAdjustParamater)];
        [self addSubview:_imageView];
        _buynow = [[UIButton alloc]initWithFrame:CGRectMake(110 * kAdjustParamater, kScreenHeight - 180, kScreenWidth - 200 * kAdjustParamater, 33 * kAdjustParamater)];
        [_buynow setTitle:@"立即购买" forState:UIControlStateNormal];
        [_buynow setBackgroundColor:kYellowColor];
        [_buynow setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _buynow.titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k17Big];
        _buynow.layer.cornerRadius = 5 * kAdjustParamater;
        _buynow.layer.masksToBounds = YES;
        [_buynow addTarget:self action:@selector(buynow:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_buynow];
    }
    
    [self setBorderCornerRadius:0 bordercolor:nil cornerRadius:10];
    return self;
}


- (void)buynow:(UIButton *)sender{
    if ([_delegate respondsToSelector:@selector(gotobuy)]) {
        [self.delegate gotobuy];
    }
    
}


@end
